package com.example.demo.controller;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @program: demo
 * @author: JCM
 * @create: 2023-02-26 10:35
 * @description:
 **/
@RequestMapping("/user")
@Controller
@ResponseBody// 返回的数据而非页面
public class UserController {

    //1. 得到日志对象
    private static final Logger logger = LoggerFactory.getLogger(UserController.class);


    @RequestMapping("/hi")
    public String sayHi() {
        // 写日志
        logger.trace("我是trace");
        logger.debug("我是debug");
        logger.info("我是info");
        logger.warn("我是warn");
        logger.error("我是error");

        return "hallo,userController";
    }
}
